﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MCDirectBroadcast.Entity;
using System.Xml.Linq;
using System.Xml.XPath;

namespace MCDirectBroadcast
{
	public static class StoryFactory
	{
		public static List<Story> GetList()
		{
			List<Story> items = SQLCeHelper.Stories();
			return items;
		}
		/*
		public static List<Story> GetList2()
		{
			List<Story> items = new List<Story>();

            string xml = @"Resources\Others\samples.xml";
			XDocument xd = XDocument.Load(xml);

			var l = xd.XPathSelectElements("//message");
			foreach (var i in l)
			{
				string ss = i.Element("title").Value;
				if (ss.Length > 30)
					ss = ss.Substring(0, 30);
				items.Add(new Story()
				{
					ID = i.Element("uid").Value,
					Title = ss,
					TimeToGo = i.Element("time").Value,
					Location = i.Element("loc").Value,
					Content = i.Element("content").Value,
					CreateDate = "04 Jan, 11"
				});
			}

			return items;
		}*/
	}
}
